/*
 * @(#)EvolutionController.java   09/10/11
 * 
 * Copyright (C) 2009 Ecole des Mines d'Ales
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Contact: yulinz88@gmail.com
 */



package fr.ema.arch3d.ref.controllers.interfaces;

import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.IllegalBindingException;
import org.objectweb.fractal.api.control.IllegalContentException;
import org.objectweb.fractal.api.control.IllegalLifeCycleException;
import org.objectweb.fractal.api.factory.InstantiationException;

import java.io.IOException;

import java.util.Vector;

//~--- interfaces -------------------------------------------------------------

/**
 * Interface description
 *
 *
 * @version        1.0, 09/09/13
 * @author         Enter your name here...
 */
public interface EvolutionController {

    /**
     *
     * @param oldComp: old Component
     * @param itfNames: old component affected interface
     * @param newComp: new component
     * @param ePurpose: evolution purpose
     * @param testTimes: test times of off and online
     * @param condition: the condition test  for evolution  purpose
     * @throws Exception
     */
    public void ComponentEvolution(Component oldComp, String itfNames, Component newComp, String ePurpose,
                                   int testTimes, String condition)
            throws Exception;

    /**
     * Method description
     *
     * @param oldComp  
     * @param itfName  
     * @param newComp  
     * @param ePurpose  
     * @param condition  
     * @throws Exception  
     */
    public void ComponentEvolution(Component oldComp, String itfName, Component newComp, String ePurpose,
                                   String condition)
            throws Exception;

    /**
     * Method description
     *
     * @param connector  
     * @param result  
     * @throws NoSuchInterfaceException  
     */
    public void finishOfflineTestP(Component connector, Object[][] result) throws NoSuchInterfaceException;

    /**
     * Method description
     *
     * @param connector  
     * @param result  
     * @throws NoSuchInterfaceException  
     */
    public void finishOnlineTestP(Component connector, Object[][] result) throws NoSuchInterfaceException;

    /**
     * Method description
     *
     * @param connector  
     * @param result  
     * @throws NoSuchInterfaceException  
     */
    public void finishOfflineTestR(Component connector, Object[][] result) throws NoSuchInterfaceException;

    /**
     * Method description
     *
     * @param connector  
     * @param result  
     * @throws NoSuchInterfaceException  
     */
    public void finishOnlineTestR(Component connector, Object[][] result) throws NoSuchInterfaceException;

    /**
     * Method description
     *
     * @param comp  
     * @throws Exception  
     */
    public void disconnect(Component comp) throws Exception;

    /**
     * Method description
     *
     * @param a  
     * @param aItfName  
     * @param b  
     * @param bItfName  
     * @throws ClassNotFoundException  
     * @throws IOException  
     * @throws IllegalBindingException  
     * @throws IllegalContentException  
     * @throws IllegalLifeCycleException  
     * @throws InstantiationException  
     * @throws InterruptedException  
     * @throws NoSuchInterfaceException  
     */
    public void connect(Component a, String aItfName, Component b, String bItfName)
            throws NoSuchInterfaceException, IllegalContentException, IllegalLifeCycleException,
                   InstantiationException, IOException, ClassNotFoundException, InterruptedException,
                   IllegalBindingException;

    /**
     * Method description
     *
     * @param resultT  
     */
    public void finishTestTEM(Object[][] resultT);

    /**
     * Method description
     *
     * @param c  
     * @return  
     * @throws NoSuchInterfaceException  
     */
    public Vector findSub(Component c) throws NoSuchInterfaceException;
}
